/*
 * @Copyright: Copyright (c) 2021 andyten
 * @Description: 全局自定义指令
 * @Author: andy.ten@tom.com
 * @Date: 2021-10-21 21:23:25
 * @LastEditors: andy.ten@tom.com
 * @LastEditTime: 2021-10-21 21:28:25
 * @Version: 1.0.1
 */

export default {
  bind: function (el, binding, vnode) {
    el.style.position = 'fixed';
    var s = JSON.stringify;
    el.innerHTML = 'name: ' + s(binding.name) + '<br>' + 'value: ' + s(binding.value) + '<br>' + 'expression: ' + s(binding.expression) + '<br>' + 'argument: ' + s(binding.arg) + '<br>' + 'modifiers: ' + s(binding.modifiers) + '<br>' + 'vnode keys: ' + Object.keys(vnode).join(', ');
    var s1 = binding.arg == 'left' ? 'left' : 'top';
    el.style[s1] = binding.value + 'px';
    el.style.top = binding.value + 'px';
  },
}